home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / utilities / pu426.dms / pu426.adf / WINHAND < prev   
Text File  |  1992-06-07  |  1KB  |  91 lines

  1. *
  2. * Windowing routines (w)1991 BSI...
  3. *
  4.  
  5. * Open our font...
  6. openwin:textfont=openfont(texattr)
  7.  
  8. * Open the window...
  9.     windptr=openwindow(newwind)
  10.     
  11. * Get signal bit for window communication...
  12.     sgnmask=windptr+86
  13.     sgnmask=^sgnmask
  14.     sgnmask=sgnmask+15
  15.     sgnmask=^sgnmask>24
  16.     sgnmask=1<sgnmask
  17.  
  18. * Get RastPort for graphics.library functions...
  19.     rasport=windptr+50
  20.     rasport=^rasport
  21.     return
  22.  
  23. closwin:gosub remm
  24.     closewindow(windptr)
  25.     closefont(textfont)
  26.     return
  27.  
  28. * Fetch all outstanding messages...
  29. remm:    forbid()
  30. remall:    gosub nowsig
  31.     cmp mess,0,2,goto remall
  32.     permit()
  33.     return
  34.  
  35. newwind:dc.w 14,76,572,115
  36.     dc.b 2,1
  37.     dc.l $200208,$2001008,0,0
  38. wtitle:    dc.l 0,PCLSCREEN,0
  39.     dc.w -1,-1,-1,-1,$f
  40.  
  41. * Signal fetching...
  42. waitsgn:port=windptr+86
  43.     port=^port
  44.     mess=getmsg(port)
  45.     cmp mess,0,2,goto messav
  46.  
  47.     wait(sgnmask)
  48.  
  49. nowsig:    port=windptr+86
  50.     port=^port
  51.     mess=getmsg(port)
  52.     cmp mess,0,0,goto messex
  53.  
  54. messav:    class=mess+20
  55.     class=^class
  56.  
  57.     code=mess+24
  58.     code=^code>16
  59.  
  60.     iaddrs=mess+28
  61.     iaddrs=^iaddrs
  62.  
  63.     replymsg(mess)
  64. messex:    return
  65.     
  66. * Font definition...
  67. topaz:    dc.b "topaz.font",0
  68.     dc.w 0
  69. texattr:dc.l topaz
  70.     dc.w 8
  71.     dc.b 0,1
  72.  
  73. * IntuiText structure...
  74. itext:    dc.b 1,0,0,0
  75.     dc.w 0,0
  76.     dc.l texattr
  77. itstr:    dc.l 0,0
  78.  
  79. * Intuitext Centering...
  80. print3d:poke(itext,2)
  81.     pokel(itext+4,$00010001)
  82.     pokel(itstr,txtptr)
  83.     cen=intuitextlength(itext)
  84.     cen=572-cen>1
  85.     printitext(rasport,itext,cen,yyval)
  86.     poke(itext,colour)
  87.     pokel(itext+4,0)
  88.     printitext(rasport,itext,cen,yyval)
  89.     yyval=yyval+10
  90.     return
  91.